package com.broada.apm.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.broada.apm.service.AlarmService;
import com.broada.apm.service.ApplicationService;
import com.broada.apm.service.AuthenticationService;
import com.broada.apm.service.ConfigService;
import com.broada.apm.service.IndicatorService;
import com.broada.apm.service.KeyTradeService;
import com.broada.apm.service.PerformanceService;
import com.broada.apm.service.ProtocalService;
import com.broada.apm.service.ServerService;
import com.broada.apm.service.SystemService;
import com.broada.apm.service.TransactionService;
import com.broada.apm.service.TransactionService;
import com.broada.apm.service.V1PerformanceService;
import com.broada.apm.util.ApidocGenerate;

@WebServlet("/api-docs/")
public class ApidocServlet extends HttpServlet{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("utf-8");
        resp.setContentType("application/x-javascript;charset=utf-8");
        ApidocGenerate.scanClasses(resp.getWriter(), 
                AlarmService.class,
                ApplicationService.class,
                AuthenticationService.class,
                ConfigService.class,
                IndicatorService.class,
                KeyTradeService.class,
                PerformanceService.class, 
                ProtocalService.class,
                ServerService.class,
                SystemService.class,
                TransactionService.class,
                V1PerformanceService.class,
                TransactionService.class);
    }
}
